#pragma once
#include "packet.h"
#include <vector>

enum RequestID { Invalid, SlaveList, MasterList, Heart_Beat };

class request : public packet
{
	public:
		request(void);
		~request(void);

		void init( MemoryPool<request, 1000, 0, boost::function<request *(void)> > *p, uint32_t src, uint32_t dst, RequestID t ) { pool = p; source.addr = src; destination.addr = dst; }

		void destroy() { if( pool ) pool->destroy( this ); }

		void print() { printf( "Type: %s\n", ( type == Invalid ? "Invalid" : type == SlaveList ? "SlaveList" : type == MasterList ? "MasterList" : type == HeartBeat ? "HeartBeat" : "" ) ); }
	
		char *serialize();

		static uint32_t PACKET_REQUEST_SIZE;
	private:
		RequestID type;
		MemoryPool<request, 1000, 0, boost::function<request *(void)> > *pool;
};

